<template>
  <div id="app" :style="style">
    <!-- 路由占位符 -->
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: 'app',
  data() {
    return {
      path: '',
      style: ''
    }
  },
  mounted() {
    this.path = this.$route.path
    if (this.path === '/print-purchase' || this.path === '/print-order' || this.path === '/print-show') {
      this.style = 'height: 0 !important;margin: 8px !important;'
    }
  },
  watch: {
    $route(to, from) {
      if (to.path === '/print-purchase' || to.path === '/print-order' || to.path === '/print-show') {
        this.style = 'height: 0 !important;margin: 8px !important;min-width: 0 !important;'
      } else {
        this.style = 'height: 100%;margin: 0;padding: 0;min-width: 1366px;'
      }
    }
  }
}
</script>

<style>
#app {
  height: 100%;
  margin: 0;
  padding: 0;
  min-width: 1366px;
}
</style>
